#ifndef I2C_LCD_H
#define I2C_LCD_H

#include "cpu.h"

/**ist3931读写地址*/
#define IST3931_WRITE       0x78
#define IST3931_READ        0x79

/**ist3931命令、数据行识别*/
#define IST3931_COMMAND     0x80
#define IST3931_DATA        0xC0

/**通讯总线配置的宏*/
#define SDA_OUT()       GPIOA->CRL &= 0xff0fffff;GPIOA->CRL |= 0x00100000;//0101
#define SDA_IN()        GPIOA->CRL &= 0xff0fffff;GPIOA->CRL |= 0x00800000;GPIOA->ODR |= 1<<5;//0100

/**通讯总线操作宏*/
#define SDA_HIGH()      GPIOA->ODR |= (1<<5);
#define SDA_LOW()       GPIOA->ODR &= ~(1<<5);
#define SCK_LOW()       GPIOA->ODR &= ~(1<<4);
#define SCK_HIGH()      GPIOA->ODR |= (1<<4);
#define SDA_READ()      ((GPIOA->IDR)&(1<<5))

I2CStatus LCD_WriteContiBegin(void);
I2CStatus LCD_WriteContiEnd(void);
I2CStatus LCD_WriteData(INT8U Data);	//写单字节
I2CStatus LCD_WriteCommand(INT8U Command);		//写命令

#endif

